home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / programs / prog50 < prev    next >
Text File  |  1995-06-29  |  706b  |  31 lines

  1. # checking modal dialog
  2.  
  3. proc ask {parent question} {
  4.     global stillModal
  5.     global answer
  6.     
  7.     xmQuestionDialog $parent.dialog managed \
  8.         -messageString $question \
  9.         -dialogStyle dialog_full_application_modal
  10.  
  11.     $parent.dialog okCallback {set stillModal 0; set answer 1}
  12.     $parent.dialog cancelCallback {set stillModal 0; set answer 0}
  13.  
  14.     set stillModal 1
  15.     while {$stillModal} {
  16.         . processEvent
  17.     }
  18.     $parent.dialog destroyWidget
  19.     puts stdout $answer
  20. }
  21.  
  22. xtAppInitialize -class Program
  23.  
  24. xmPushButton .fred managed \
  25.     -labelString "Press here for modal dialog"
  26. .fred activateCallback "ask .fred {Confirm you are there...}; exit 0"
  27.  
  28. . realizeWidget
  29.  
  30. . mainLoop
  31.